﻿using System;
using System.Collections.Generic;


namespace Battle.Engine.LogicModel
{
    public class FBuffFactory
    {
        public static Buff CreateBuff(string buffId, EngineData data) {
            var dict = data.tableDataUtil.GetTableBuff(buffId);
            Buff result = null;
            if (dict != null) {
                switch (dict.BuffClass) {
                    case (int)BuffClass.Property:
                        result = new BuffOfProperty();
                        result.Init(dict, data);
                        break;
                    case (int)BuffClass.PropertyTransfer:
                        result = new BuffOfPropertyTransfer();
                        result.Init(dict, data);
                        break;
                    case (int)BuffClass.State:
                        result = new BuffOfState();
                        result.Init(dict, data);
                        break;
                    case (int)BuffClass.Dispel:
                        result = new BuffOfDispel();
                        result.Init(dict, data);
                        break;
                    case (int)BuffClass.Random:
                        result = new BuffOfRandom();
                        result.Init(dict, data);
                        break;
                    case (int)BuffClass.DelayCreate:
                        result = new BuffOfDelayCreate();
                        result.Init(dict, data);
                        break;
                    default:
                        break;
                }
            }
            return result;

        }
    }
}
